﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Com.ProjectA.DAO
{
    public class DAOConnectionInfo
    {
        #region Declare variables
        public string strServerValue { get; private set; }
        public string strDatabaseValue { get; private set; }
        public string strUserIdValue { get; private set; }
        public string strPasswordValue { get; private set; }
        public string strDataSourceValue { get; private set; }
        public string strTrustedConnectionValue { get; private set; }
        public string strInitialCatalogValue { get; private set; }
        public string strIntegratedSecurityValue { get; private set; }
        public string strNetworkLibraryValue { get; private set; }
        public string strMultipleActiveResultSetsValue { get; private set; }
        public string strAttachDbFilenameValue { get; private set; }
        public string strUserInstanceValue { get; private set; }
        public string strFailoverPartnerValue { get; private set; }
        public string strAsynchronousProcessingValue { get; private set; }
        #endregion Declare variables
        /// <summary>
        /// Constructure for creating connection string
        /// </summary>
        /// <param name="strServerValue">Server address or sql server name(\instance name)</param>
        /// <param name="strDatabaseValue">Data base name</param>
        /// <param name="strUserIdValue">User login to SQL server</param>
        /// <param name="strPasswordValue">Password</param>
        /// <param name="strDataSourceValue">Server address or sql server name(\instance name)</param>
        /// <param name="strTrustedConnectionValue">'True' or 'False'</param>
        /// <param name="strInitialCatalogValue">Data base name</param>
        /// <param name="strIntegratedSecurityValue">Whether the connection is to be a secure connection or not. Recognized values are 'true', 'false', and 'sspi', which is equivalent to 'true'.</param>
        /// <param name="strNetworkLibraryValue">The network library used to establish a connection to an instance of SQL Server. Using 'DBMSSOCN' = TCP/IP ...</param>
        /// <param name="strMultipleActiveResultSetsValue">When 'true', an application can maintain multiple active result sets (MARS)
        /// . When 'false', an application must process or cancel all result sets from one batch before it can execute any other batch on that connection</param>
        /// <param name="strAttachDbFilenameValue">C:\MyFolder\MyDataFile.mdf or |DataDirectory|\[my folder]\mydbfile.mdf</param>
        /// <param name="strUserInstanceValue">A value that indicates whether to redirect the connection 
        /// from the default SQL Server Express instance to a runtime-initiated instance running under 
        /// the account of the caller. 'true' or 'false'</param>
        /// <param name="strFailoverPartnerValue">myMirrorServerAddress</param>
        /// <param name="strAsynchronousProcessingValue">When true, enables asynchronous operation support. Recognized values are 'true', 'false', 'yes', and 'no'.</param>
        public DAOConnectionInfo(string strServerValue = null, string strDatabaseValue = null, string strUserIdValue = null
                                , string strPasswordValue = null, string strDataSourceValue = null, string strTrustedConnectionValue = null
                                , string strInitialCatalogValue = null, string strIntegratedSecurityValue = null, string strNetworkLibraryValue = null
                                , string strMultipleActiveResultSetsValue = null, string strAttachDbFilenameValue = null, string strUserInstanceValue = null
                                , string strFailoverPartnerValue = null, string strAsynchronousProcessingValue = null)
        {
            this.strServerValue = strServerValue == null ? String.Empty : strServerValue;
            this.strDatabaseValue = strDatabaseValue == null ? String.Empty : strDatabaseValue;
            this.strUserIdValue = strUserIdValue == null ? String.Empty : strUserIdValue;
            this.strPasswordValue = strPasswordValue == null ? String.Empty : strPasswordValue;
            this.strDataSourceValue = strDataSourceValue == null ? String.Empty : strDataSourceValue;
            this.strTrustedConnectionValue = strTrustedConnectionValue == null ? String.Empty : strTrustedConnectionValue;
            this.strInitialCatalogValue = strInitialCatalogValue == null ? String.Empty : strInitialCatalogValue;
            this.strIntegratedSecurityValue = strIntegratedSecurityValue == null ? String.Empty : strIntegratedSecurityValue;
            this.strNetworkLibraryValue = strNetworkLibraryValue == null ? String.Empty : strNetworkLibraryValue;
            this.strMultipleActiveResultSetsValue = strMultipleActiveResultSetsValue == null ? String.Empty : strMultipleActiveResultSetsValue;
            this.strAttachDbFilenameValue = strAttachDbFilenameValue == null ? String.Empty : strAttachDbFilenameValue;
            this.strUserInstanceValue = strUserInstanceValue == null ? String.Empty : strUserInstanceValue;
            this.strFailoverPartnerValue = strFailoverPartnerValue == null ? String.Empty : strFailoverPartnerValue;
            this.strAsynchronousProcessingValue = strAsynchronousProcessingValue == null ? String.Empty : strAsynchronousProcessingValue;
        }
    }
}
